package com.jams.goodox.entity;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * Created by jams_zhen on 2017/5/3.
 */

public class MeetDateBean implements Serializable{

    private String dateStr;//用于日历显示 1，2

    private boolean canReserve;//场地是否可以预定

    private boolean havePlace;//此标识是否有场地

    private boolean isCheckDate;//是否选中的场次

    private int month;

    private Date date;

    private int dayOfWeek;

    private String formatDate;

    private Calendar cal = Calendar.getInstance();

    /**
     * 获取一周中的星期几
     * @return
     */
    public int getDayOfWeek() {
        return dayOfWeek;
    }

    public int getMonth() {
        return month;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
        cal.setTime(date);
        int w = cal.get(Calendar.DAY_OF_WEEK);
        if (w < 1)
            w = 1;
        this.dayOfWeek=w;
        this.month=cal.get(Calendar.MONTH);
        if (date != null) formatDate = sdf.format(date);
    }

    public String getDateStr() {
        return dateStr;
    }

    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");//小写的mm表示的是分钟

    public String getFormatDate() {
        return formatDate == null ? "0" : formatDate;
    }

    public void setFormatDate(String formatDate) {
        this.formatDate=formatDate;
    }

    public void setDateStr(String dateStr) {
        this.dateStr = dateStr;
    }

    public boolean isCanReserve() {
        return canReserve;
    }

    public void setCanReserve(boolean canReserve) {
        this.canReserve = canReserve;
    }

    public boolean isHavePlace() {
        return havePlace;
    }

    public void setHavePlace(boolean havePlace) {
        this.havePlace = havePlace;
    }

    public boolean isCheckDate() {
        return isCheckDate;
    }

    public void setCheckDate(boolean checkDate) {
        isCheckDate = checkDate;
    }
}
